<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2018/5/30
 * Time: 11:40
 */

namespace app\model;


class Music extends Model
{
    public function __construct()
    {
        $this->table = "music";
    }

    public function getVideoMusicInfo($materialId,$musicId)
    {
        $this->db->select("a.*,b.music_url");
        $this->db->from("video_music as a");
        $this->db->join("music as b","a.music_id=b.id");
        $this->db->where(["a.material_id"=>$materialId,"a.music_id"=>$musicId]);
        $query = $this->db->get();
        return $query->one();
    }
}